package com.hanhanxiaochong.zhongxiangchuanmei.view.my.adapter;

import android.content.Context;

import com.hanhanxiaochong.zhongxiangchuanmei.R;
import com.hanhanxiaochong.zhongxiangchuanmei.bean.TechnicianOrderItem;
import com.hanhanxiaochong.zhongxiangchuanmei.config.CommonAdapter;
import com.hanhanxiaochong.zhongxiangchuanmei.config.ViewHolder;
import com.hanhanxiaochong.zhongxiangchuanmei.util.ResourcesUtils;
import com.wzgiceman.rxretrofitlibrary.retrofit_rx.utils.TimeUtils;

import java.util.List;

/**
 * Created by RockPhoenix on 2018/6/10.
 */

public class TechOrderAdapter extends CommonAdapter<TechnicianOrderItem> {

    public TechOrderAdapter(Context context, int layoutId, List<TechnicianOrderItem> datas) {
        super(context, layoutId, datas);
    }

    @Override
    protected void convert(ViewHolder holder, TechnicianOrderItem bean, int position) {
        holder.setText(R.id.tv_project_name, bean.getP_name());
        holder.setText(R.id.tv_name_phone, String.format(ResourcesUtils.getString(R.string.customer_name_phone), bean.getUser_nicename(), ""));
        holder.setText(R.id.tv_order_num,String.format(ResourcesUtils.getString(R.string.order_num),bean.getOrder_num()));
        holder.setText(R.id.tv_technician_name,String.format(ResourcesUtils.getString(R.string.order_technician),bean.getTech_name()));
        holder.setText(R.id.tv_service_shop,String.format(ResourcesUtils.getString(R.string.service_shop),bean.getR_name()));
        holder.setText(R.id.tv_service_time,String.format(ResourcesUtils.getString(R.string.order_service_time), TimeUtils.getDateFromSeconds(bean.getTment_time())));
    }
}
